/**
 * 
 */
package utility.math;

import java.io.Serializable;

/**
 * @author tioz
 *
 */
public class Translation implements Transformation, Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4262370726489093351L;

	/**
	 * 
	 */
	
	
	Vector2D translation;
	
	public Translation(Vector2D translation) {
		this.translation = translation;
	}

	/* (non-Javadoc)
	 * @see utility.math.Transformation#ApplyTo(utility.math.Vector2D)
	 */
	@Override
	public Vector2D applyTo(Vector2D vec) {
		return vec.plus(translation);
	}

	/* (non-Javadoc)
	 * @see utility.math.Transformation#Transform(utility.math.Vector2D)
	 */
	@Override
	public void transform(Vector2D vec) {
		vec.setX(vec.getX()+translation.getX());
		vec.setY(vec.getY()+translation.getY());
	}

}
